import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import xyz.weizhi.config.weizhiConfig;
import xyz.weizhi.pojo.Student;
import xyz.weizhi.pojo.User;

/**
 * @Author milian
 * @Date 2021/9/4 0004 19:58
 */
public class Mytest {
    public static void main(String[] args) {
       ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
        Student student = context.getBean("student", Student.class);
        System.out.println(student);
        Student student2 = context.getBean("student2", Student.class);
        System.out.println(student2);
        Student student3 = context.getBean("student3", Student.class);
        System.out.println(student3);
        AnnotationConfigApplicationContext context1 = new AnnotationConfigApplicationContext(weizhiConfig.class);
        User user = context1.getBean("getUser", User.class);
        System.out.println(user);

    }
}
